home *** CD-ROM | disk | FTP | other *** search
- Subject: ContainingPartPropertiesUpdated
- Sent: 6/20/96 9:21 AM
- Received: 6/24/96 8:25 AM
- From: Uwe Schoeneberg, odf@SoftGene.SpaceNet.de
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- I find container properties very useful in my project.
-
- In ODFd11 "ContainingPartPropertiesUpdated" had not yet been implemented.
- Following the descriptions in the OpenDoc Programmer's Guide ("Adopting
- Container Properties", p. 115; "Transmitting Your Container properties to
- Embedded Parts", p. 127) and since "FW_CODPart" wraps "ODPart" for us, I
- found it obvious to code "FW_CODPart::ContainingPartPropertiesUpdated" as
- follows:
-
- FW_CODPart::ContainingPartPropertiesUpdated(...):
- {...
-
- FW_TRY
- {
- FW_CFrame* frame = FW_CFrame::ODtoFWFrame(ev, odFrame);
- FW_ASSERT(frame);
- FW_CPart* part = frame->GetPart(ev); // no other way to retrieve
- // part from FW_CODPart ?
- FW_ASSERT(part);
- part->ContainingPartPropertiesUpdated(ev, odFrame, propertyUnit);
- }
- FW_CATCH_BEGIN
-
- ...}
-
- and then have the part adjust its properties in my overwrite to
- "FW_CPart::ContainingPartPropertiesUpdated". Here, I was iterating to all
- embedded parts to make sure changes get propagated down the hierarchy.
-
- In ODF R1, "FW_CODPart" detours the flow via "FW_CFrame". In the overwrite
- to "FW_CFrame::ContainingPartPropertiesUpdated" I will have to grant
- "FW_CFrame" access to (otherwise private) part properties (unvealing their
- data structure) or to wrap accessors to them. Example:
-
- void CMyPart::ContainingPartPropertiesUpdated(...)
- {...
- fPropertyA->Adjust(...);
- ...}
-
- becomes
-
- void CMyFrame::ContainingPartPropertiesUpdated(...)
- {...
- CPropertyAType* propertyA = fCMyPart->GetPropertyA();
- propertyA->Adjust(...);
- ...}
-
- CPropertyAType* CMyPart::GetPropertyA()
- {
- return fPropertyA;
- }
-
- or
-
- void CMyFrame::ContainingPartPropertiesUpdated(...)
- {...
- fCMyPart->AdjustPropertyA(...);
- ...}
-
-
- void CMyPart::AdjustPropertyA(...)
- {
- fPropertyA->Adjust(...);
- }
-
- Both cases are difficult to maintain as more adjustable properties are
- added in later versions of my project.
-
- The same thought applies to "AcquireContainingPartProperties".
-
- Any reason I don't see for the detour in ODF R1?
-
- Uwe Schoeneberg
-
-
- -----------------------------------------------------------------------------
- Soft Gene GmbH
- Offenbacher Str. 5
- 14 197 Berlin Tel: +49-30 841 71 50
- Germany Fax: +49-30 821 97 64
-
-
-
-
-